import urllib.request as ur
from . import user_agent

request = ur.Request(
    url='https://edu.csdn.net/',
    headers={
        # 每次选择不同的header,绕过后台服务器的拦截
        'User-Agent':user_agent.get_user_agent_pc()
    }
)

response = ur.urlopen(request).read()